<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>


<s:layout-render name="/backend/layout.jsp" title="moduleNames.booking" selectedPage="booking">
    <s:layout-component name="left-column">
        <h3><f:message key="global.menu" /></h3>
        <ul class="nav">
            <li><s:link beanclass="cz.muni.fi.pa165.bookingmanager.web.HotelActionBean" event="all"><f:message key="global.back_to_list" /> <f:message key="moduleNames.fourth_variant.hotels" /></s:link></li>        
        </ul>
    </s:layout-component>
    <s:layout-component name="body">
       <s:useActionBean beanclass="cz.muni.fi.pa165.bookingmanager.web.BookingActionBean" var="actionBean"/>    
        <div class="table">
            <table class="listing" cellpadding="0" cellspacing="0">
                <img src="${pageContext.request.contextPath}/backend/img/bg-th-left.gif" width="8" height="7" alt="" class="left" /> 
                <img src="${pageContext.request.contextPath}/backend/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
                <tr>
                    <th class="first"><f:message key="global.hotel.customers" /> ${actionBean.context.hotel.name}</th>
                </tr>
                <tr>
                    <th class="first"><f:message key="entities.customer.first_name" /></th>
                    <th><f:message key="entities.customer.surname" /></th>
                    <th class="last"><f:message key="entities.customer.number_of_id_card" /></th>                    
                </tr>
                <% int i = 0;  %>
                <c:forEach var="customer" items="${actionBean.getList()}" >
                    <tr <% if(i%2 == 0){ out.print(" class='bg' "); } i++; %>>                       
                        <td class="first_style1"><c:out  value="${customer.firstName}"/></td>
                        <td><c:out value="${customer.surName}"/></td>
                        <td><c:out value="${customer.numberOfIdCard}"/></td>
                        </tr>                 
                </c:forEach>
           </table>                 
           </div> 
                <s:form beanclass="cz.muni.fi.pa165.bookingmanager.web.BookingActionBean">               
            <c:import url="form.jsp">
                <c:param name="header" value="global.search" />
            </c:import>
            <s:submit class="button" name="findAllCurrentCustomersInHotel"><f:message key="global.search" /></s:submit>
        </s:form>
    </s:layout-component>
</s:layout-render>
